import React from 'react';
import { Dialog, Button } from '@alifd/next';
import { t } from '@lingui/macro';
import { observer } from 'mobx-react-lite';

const SubmitDialogComponent = ({ visible, member, onSubmit, onClose }) => {
  return (
    <Dialog
      v2
      visible={visible}
      top={300}
      title={t`新成员原有车辆信息是否保留，并进入公司车辆信息？`}
      onClose={() => onClose?.()}
      footer={[
        <Button key="submit" type="primary" onClick={() => onSubmit?.({ ...toJS(member), saveVehicle: true })}>
          {t`是`}
        </Button>,
        <Button key="cancel" type="primary" style={{ marginLeft: 8 }} onClick={() => onSubmit?.({ ...toJS(member), saveVehicle: false })}>
          {t`否`}
        </Button>,
        <Button key="close" style={{ marginLeft: 8 }} onClick={() => onClose?.()}>
          {t`取消`}
        </Button>,
      ]}
    />
  );
};

export default observer(SubmitDialogComponent);
